<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>AI Cloud</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="/layui/css/layui.css" rel="stylesheet">
</head>

<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">AI Cloud</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul id="chat-nav" class="layui-nav layui-layout-left " style="display: none;">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
            <li class="layui-nav-item layui-hide-xs"><a href="javascript:;" data-ai="chat">CHATGPT</a></li>
            <li class="layui-nav-item layui-hide-xs"><a href="javascript:;" data-ai="tongyi">通义千问</a></li>
            <li class="layui-nav-item layui-hide-xs"><a href="javascript:;" data-ai="xunfei">讯飞星火</a></li>
            <li class="layui-nav-item layui-hide-xs"><a href="javascript:;" data-ai="wenxin">文心一言</a></li>
        </ul>
        <ul id="discuss-nav" class="layui-nav layui-layout-left " style="display: none;">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
            <li class="layui-nav-item layui-hide-xs"><a href="javascript:;">推荐</a></li>
            <li class="layui-nav-item layui-hide-xs"><a href="javascript:;">最新</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
                <a href="javascript:;">
                    <img src="//unpkg.com/outeres@0.0.10/img/layui/icon-v2.png" class="layui-nav-img">
                    tester
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;">Your Profile</a></dd>
                    <dd><a href="javascript:;">Settings</a></dd>
                    <dd><a href="javascript:;">Sign out</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                <a href="javascript:;">
                    <i class="layui-icon layui-icon-more-vertical"></i>
                </a>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">AI工具箱</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" data-show="chat-nav">对话</a></dd>
                        <dd><a href="javascript:;" data-show="chat-nav">绘图</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" lay-on="discuss-nav-show"><a href="javascript:;" data-show="discuss-nav">话题讨论</a></li>
                <li class="layui-nav-item"><a href="javascript:;">关于</a></li>
            </ul>
        </div>
    </div>
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div>
            <div style="padding: 15px;">

                <div id="chat-chatgpt" class="layui-card layui-panel">
                    <div class="layui-card-header layui-font-16">
                        chatgpt 提出的问题
                    </div>
                    <div class="layui-card-body">
                        chatgpt回答的答案
                    </div>
                </div>
                <div id="tongyi-chat-chatgpt" class="layui-card layui-panel" style="display: none;">
                    <div class="layui-card-header layui-font-16">
                        tongyi 提出的问题
                    </div>
                    <div class="layui-card-body">
                        tongyi回答的答案
                    </div>
                </div>
                <div id="xunfei-chat-chatgpt" class="layui-card layui-panel" style="display: none;">
                    <div class="layui-card-header layui-font-16">
                        xunfei提出的问题
                    </div>
                    <div class="layui-card-body">
                        xunfei回答的答案
                    </div>
                </div>
                <div id="wenxin-chat-chatgpt" class="layui-card layui-panel" style="display: none;">
                    <div class="layui-card-header layui-font-16">
                        wenxin提出的问题
                    </div>
                    <div class="layui-card-body">
                        wenxin回答的答案
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-footer " style="height: 80px;line-height: 80px;">
        <!-- 底部固定区域 -->
        <div style="width: 100%;">
            <div class="layui-input-group" style="width: 100%;">

                <input style="margin-top: 20px; margin-left: 160px;" type="text" placeholder="输入问题" class="layui-input">
                <div class="layui-input-suffix">
                    <button type="button" style="margin-left: 50px" class="layui-btn layui-btn-radius">发送</button>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/layui/layui.js"></script>
<script>
    layui.use(['element', 'layer', 'util', 'jquery'], function () {
        var element = layui.element;
        var layer = layui.layer;
        var util = layui.util;
        var $ = layui.$;

        // 左侧菜单点击事件
        $('.layui-nav-tree a').on('click', function () {
            var showId = $(this).data('show');
            $('#chat-nav, #discuss-nav').hide();
            if (showId) {
                $('#' + showId).show();
            }
        });

        // 头部聊天导航点击事件
        $('#chat-nav a').on('click', function () {
            var ai = $(this).data('ai');
            // 隐藏所有内容区域
            $('#chat-chatgpt, #tongyi-chat-chatgpt, #xunfei-chat-chatgpt, #wenxin-chat-chatgpt').hide();
            // 单独处理 CHATGPT 的显示（因为其 ID 结构特殊）
            if (ai === 'chat') {
                $('#chat-chatgpt').show();
            } else {
                $('#' + ai + '-chat-chatgpt').show();
            }
        });

        // 头部事件
        util.event('lay-header-event', {
            menuLeft: function (othis) {
                layer.msg('展开左侧菜单的操作', { icon: 0 });
            },
            menuRight: function () {
                layer.open({
                    type: 1,
                    title: '更多',
                    content: '<div style="padding: 15px;">处理右侧面板的操作</div>',
                    area: ['260px', '100%'],
                    offset: 'rt',
                    anim: 'slideLeft',
                    shadeClose: true,
                    scrollbar: false
                });
            }
        });
    });
</script>
</body>

</html>